:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --text-color: #333;
    --light-text: #777;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav li {
    margin-left: 1.5rem;
}

.nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav a:hover, .nav a.active {
    color: var(--primary-color);
}

/* 主体内容 */
.main {
    display: flex;
    margin: 2rem auto;
    gap: 2rem;
}

/* 侧边栏 */
.sidebar {
    flex: 0 0 250px;
}

.profile {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 2rem;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 1rem;
    object-fit: cover;
}

.profile h2 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.profile p {
    color: var(--light-text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.categories {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.categories h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.categories ul {
    list-style: none;
}

.categories li {
    margin-bottom: 0.5rem;
}

.categories a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.categories a:hover {
    color: var(--primary-color);
}

/* 内容区域 */
.content {
    flex: 1;
}

.diary-list {
    display: grid;
    gap: 1.5rem;
}

.diary-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.diary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.diary-card h3 {
    margin-bottom: 0.8rem;
    color: var(--secondary-color);
}

.meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.date {
    color: var(--light-text);
}

.category {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.diary-card p {
    margin-bottom: 1.2rem;
    color: var(--light-text);
}

.read-more, .back-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.read-more:hover, .back-btn:hover {
    background: #2980b9;
}

/* 日记详情 */
.diary-detail {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.diary-detail h2 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.diary-detail .meta {
    margin-bottom: 1.5rem;
}

.hidden {
    display: none;
}

/* 页脚 */
.footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main {
        flex-direction: column;
    }
    
    .sidebar {
        flex: 0 0 auto;
        margin-bottom: 2rem;
    }
    
    .header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .nav ul {
        margin-top: 1rem;
        justify-content: center;
    }
    
    .nav li {
        margin: 0 0.5rem;
    }
}